Skip to main content

Deployment

Project Extraction

  • First you have to extract the whoxa-app.zip or whoxa-web.zip or whoxa-business-app.zip then you will get two zip files.

    • whoxa-admin.zip (If you have business App or Web Version)
    • whoxa-website.zip (If you have regular Web Version)
    • whoxa-app.zip (If you have Regular App Version)
    • whoxa-backend.zip (If you have regular Web or App Version)
    • whoxa-business-backend.zip (If you have business Web or App Version)
    • whoxa-business-admin.zip (If you have business app Version)
    • whoxa-business-app.zip (If you have Business App Version)
  • Upload whoxa-backend.zip or whoxa-business-backend.zip to a location where you want to deploy Project using FileZilla

    • /var/www/whoxa (This is the recommended location)
  • Install unzip to unzip the Project . Run following command to install unzip

sudo apt install unzip
unzip whoxa-backend.zip

Configurations

  • After the extraction you will see the Project files

ENV file configurations (For Regular version)

  • Make a .env file from the demo.env in the project on folder which contain package.json with following content.
Port="3047"
NODE_ENV="production"
screteKey="screteKey"
DB_USERNAME="postgres"
DB_PASSWORD="root@1142"
DB_DATABASE="whoxa_advanced"
JWT_EXPIRY="24h"
baseUrl="http:{{HOST}}:{{PORT}}"
TWILIO_ACCOUNT_SID="TWILIO_ACCOUNT_SID"
TWILIO_AUTH_TOKEN="TWILIO_AUTH_TOKEN"
TWILIO_PHONE_NUMBER="TWILIO_PHONE_NUMBER"
MSG91_SENDER_ID="MSG91_SENDER_ID"
MSG91_API_KEY="MSG91_API_KEY"
MSG91_TEMPLATE_ID="MSG91_TEMPLATE_ID"
IS_TWILIO_ENABLED=true
IS_MSG91_ENABLED=false
IS_CLIENT=true
ONE_SIGNAL_APP_ID="ONE_SIGNAL_APP_ID"
ONE_SIGNAL_API_KEY="ONE_SIGNAL_API_KEY"
ANDROID_CHANNEL_ID="ANDROID_CHANNEL_ID"

ENV file configurations (For Business version)

  • Make a .env file from the demo.env in the project on folder which contain package.json with following content.
Port="3047"
NODE_ENV="production"
screteKey="screteKey"
DB_USERNAME="postgres"
DB_PASSWORD="root@1142"
DB_DATABASE="whoxa_advanced"
JWT_EXPIRY="24h"
baseUrl="http:{{HOST}}:{{PORT}}"
TWILIO_ACCOUNT_SID="TWILIO_ACCOUNT_SID"
TWILIO_AUTH_TOKEN="TWILIO_AUTH_TOKEN"
TWILIO_PHONE_NUMBER="TWILIO_PHONE_NUMBER"
MSG91_SENDER_ID="MSG91_SENDER_ID"
MSG91_API_KEY="MSG91_API_KEY"
MSG91_TEMPLATE_ID="MSG91_TEMPLATE_ID"
IS_TWILIO_ENABLED=true
IS_MSG91_ENABLED=false
IS_CLIENT=true
ONE_SIGNAL_APP_ID_BUSINESS="ONE_SIGNAL_APP_ID_BUSINESS"
ONE_SIGNAL_API_KEY_BUSINESS="ONE_SIGNAL_API_KEY_BUSINESS"
ANDROID_CHANNEL_ID_BUSINESS="ANDROID_CHANNEL_ID_BUSINESS"

Server Starting

  • Open Terminal on the location where package.json is located.
  • Run following command to install dependencies
npm install
  • After successful running of npm install install global dependency to auto configure the DB related tasks by running following command.
npm install -g sequelize sequelize-cli
  • To install PM2 Globally
npm install -g pm2
  • To run server run following command within the terminal where package.json is located.
pm2 start index.js --name whoxa

Peer Js installation

  • Install PeerJS globally
npm install -g peer
  • Run following command to run peer server on port 4001
pm2 start "peerjs --port 4001" --name "peerjs-server"

Auto restart on server reboot

  • Run following command to save all the process running on pm2
pm2 save
  • Run following command to restart all the saved processes on server restart
pm2 startup systemd
  • Run following command to see running pm2 processes
pm2 status
  • Run following command to see logs of a process
pm2  log {index}

Open webpages

For Web version

Frontend will be at

http://{your_server_ip}:{port_on_which_server_is_running}

Admin Panel will be at

http://{your_server_ip}:{port_on_which_server_is_running}/admin

For App version

Admin Panel will be at

http://{your_server_ip}:{port_on_which_server_is_running}

Default API Endpoint in both App and Web Version

http://{your_server_ip}:{port_on_which_server_is_running}/api
Default Admin Login Credentials
  • email:
demo@whoxa.com
  • password:
Admin@123?